﻿@model ShivamEMR.Model.Domain.UserDomain.User
@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";  
}
<h3>  Create User</h3>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <div class='metro-pivot'>
        <div class='pivot-item'>
     @*       <h3>
                Section1</h3>*@
            <table width="100%" cellpadding="4" cellspacing="4">
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.UserCode)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.UserCode)
                            @Html.ValidationMessageFor(model => model.UserCode)
                        </div>
                    </td>
               
              
                    <td>
                        <div class="editor-label">
                            Employee
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.DropDownListFor(model => model.PersonID, ((IEnumerable<ShivamEMR.Model.Domain.CompanyDomain.Employee>)ViewBag.PossibleEmployees).Select(option => new SelectListItem
                       {
                           Text = Html.DisplayTextFor(_ => option.FullName).ToString(),
                           Value = option.ID.ToString(),
                           Selected = (Model != null) && (option.ID == Model.ID)
                       }), "Choose...")
                            @Html.ValidationMessageFor(model => model.PersonID)
                        </div>
                    </td>
                
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Name)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Name)
                            @Html.ValidationMessageFor(model => model.Name)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Password)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.PasswordFor(model => model.Password)
                            @Html.ValidationMessageFor(model => model.Password)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Notes)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Notes)
                            @Html.ValidationMessageFor(model => model.Notes)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            Role
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.DropDownListFor(model => model.RoleID, ((IEnumerable<ShivamEMR.Model.Domain.UserDomain.UserRole>)ViewBag.PossibleRoles).Select(option => new SelectListItem
{
    Text = Html.DisplayTextFor(_ => option.Role).ToString(),
    Value = option.ID.ToString(),
    Selected = (Model != null) && (option.ID == Model.RoleID)
}), "Choose...")
                            @Html.ValidationMessageFor(model => model.RoleID)
                        </div>
                    </td>
                </tr>
               
                <tr>
                </tr>
            </table>
        </div>
    </div>
    <p>
        <input type="submit" value="Create" />
    </p>
    
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
<script>
    $(function () {
        $("div.metro-pivot").metroPivot();
    });
</script>
